<?php
/*
* This is the sample configuration file for Ramble!
* Before you do anything else, please fill out the
* database information below and save it as config.php
* so that everything will work correctly. Enjoy!
*/
# Turn off errors
ini_set('display_errors','off');
error_reporting(0);
# Configure MySQL Information here
$config['mysql'] = array();
$config['mysql']['server']      = "localhost"; # Server you use to connect for MySQL. Normally will be localhost.
$config['mysql']['user']        = "root"; # Username you use. Usually root.
$config['mysql']['password']    = ""; # Password you use. Remember to fill this in!
$config['mysql']['database']    = "ramble"; # Database you're using for forum information
$config['mysql']['prefix']      = "ramble_"; # Prefix you're using for tables
# Grab configuration stored in database (DO NOT EDIT THIS)
$db = mysql_connect($config['mysql']['server'],$config['mysql']['user'],$config['mysql']['password']);
mysql_select_db($config['mysql']['database']);
$sql = mysql_query("SELECT * FROM {$config['mysql']['prefix']}config");
while($conf = mysql_fetch_array($sql,MYSQL_ASSOC))
{
list($cat,$key) = explode("_",$conf["config_name"]);
    if(!isset($config[$cat]) or !is_array($config[$cat])) $config[$cat] = array();
    $config[$cat][$key] = $conf["config_value"];
}
$loggedin = ($_COOKIE['ramble_id'] and !$_COOKIE['ramble_logout']);
if($loggedin)
{
    $sql = "SELECT user_preferences FROM {$config['mysql']['prefix']}users WHERE user_id={$_COOKIE['ramble_id']}";
    $sql = mysql_query($sql);
    $c = mysql_result($sql,0);
    foreach(explode(',',$c) as $c2)
    {
        list($k,$v) = explode(':',$c2);
        list($g,$k) = explode('_',$k);
        $config[$g][$k] = str_replace(array('"'),array(""),$v);
    }
}
mysql_close($db);
$atags = "<".implode("><",explode(" ",$config['parse']['tags'])).">"; # Tags to be filtered
include "i18n.php";
$i18n = i18n_create("i18n_XML","./lang","{$config['lang']['default']}, en-us");
?>